<?php

header("Access-Control-Allow-Origin: *");
//跳转查询
include_once '../../library/config.php';
include_once '../../model/gponuserlist.php';

$entity = new GponUser();
$list = new GponUser();
$entity->request();

try {
    $duanzi=$entity['duanzi'];
    $neirong = $entity['neirong'];
    
    $list->select()->where('shangjifenguangqi=' . "'" . $neirong . "' and duanzi=".$duanzi)->get_first_rows();
    $list->remove(array('id'));
    $arr=[
        "设备名称"=>$list['shebeimingcheng'],
        "所属局站"=>$list['juzhan'],
        "所属机房"=>$list['jifang'],
        "所属局向"=>$list['juxiang'],
        "厂商标识"=>$list['changshangbiaoshi'],
        "设备型号"=>$list['shebeixinghao'],
        "设备EID"=>$list['shebei_EID'],
        "大VLAN"=>$list['da_VLAN'],
        "sn码"=>$list['sn_code'],
        "电话号码"=>$list['tel'],
        "宽带账号"=>$list['kuandaizhanghao'],
        "设备所在地址"=>$list['dizhi'],
        "上级分光器"=>$list['shangjifenguangqi'],
        "分光器端子"=>$list['duanzi'],
        "上级设备名称"=>$list['shangjishebeimingcheng'],
        "上级设备pon口"=>$list['shangjishebei_pon_kou'],
        "投入使用日期"=>$list['tourushiyongriqi'],
        "VOIPVLAN"=>$list['VOIPVLAN'],
        "入网时间"=>$list['ruwangshijian']
    ];
    echo json_encode($arr);
} catch (Exception $exc) {
    echo $list->rsscode($exc);
}
